package com.yf.mediaserver.zlm.bean;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
public class ZlMHookResult<T>  implements Serializable {

    private static final long serialVersionUID = -681990089601690595L;

    /**
     * code == 0  操作成功
     */
    private Integer code;

    /**
     * 流端口
     */
    private Integer port;

    private T data;

    private String msg;

    public   boolean fail(){
        return  0 != code;
    }

    public static  <T> ZlMHookResult<T> success(){
        return new ZlMHookResult<T>().setCode(0);
    }

}
